
var map;

function initialize() {
    var mapProp = {
        center: new google.maps.LatLng(43.696176, 7.264719),
        zoom: 13,
        mapTypeId: google.maps.MapTypeId.ROADMAP,
        disableDefaultUI:true
    };
    map = new google.maps.Map(document.getElementById("googleMap"), mapProp);

    recupDonneesGeneric(markers);
}

function markers(data) {

    var markers = new Array();

    $(data).find("entry").each(function() {
        var id = $(this).find("ID").text();

        var lattitude = $(this).find("latitude").text();
        var longitude = $(this).find("longitude").text();

        var marker = new google.maps.Marker({
            position: new google.maps.LatLng(lattitude, longitude)
        });

        google.maps.event.addListener(marker, "click", function() {
            this.id = id;
            location = "details.html?id=" + id;
        });

        markers.push(marker);
    });
    
    markerCluster = new MarkerClusterer(map, markers);

    $(".notify-wrapper").hide();
}

google.maps.event.addDomListener(window, 'load', initialize);
